<ui:composition xmlns="http://www.w3.org/1999/xhtml"
                xmlns:h="http://java.sun.com/jsf/html"
                xmlns:f="http://java.sun.com/jsf/core"
                xmlns:ui="http://java.sun.com/jsf/facelets"
                xmlns:p="http://primefaces.org/ui"
                template="/WEB-INF/mob/template.xhtml"
                xmlns:c="http://xmlns.jcp.org/jsp/jstl/core">
    <ui:define name="content">
        <style>
            .ui-growl {
                z-index: 11000 !important; /* Set a higher z-index value */
            }
        </style>
        <h:form id="bd_orgform">
            <p:growl id="msg" life="2000" showDetail="false"/>
            <c:set var="yourBean" value="#{mkzbd.bb('bd_org').mc}"/>
            <!--标题-->
            <p:panel id="titlePanelId" style=" height: 50px; text-align: center;">
                <span style=" font-size: 27px">业务单元维护#{exampleVar}</span>
            </p:panel>

            <!--删除提示弹框-->
            <p:confirmDialog id="deleteDialog" widgetVar="deleteProductDialog" showEffect="fade" width="300"
                             message="是否删除?" header="提示" severity="warn">
                <p:commandButton value="是" action="#{yourBean.del()}"
                                 update="msg,tabT,tbs,gongneng,deleteDialog"
                                 process="@this,tabT,tbs"/>
                <p:commandButton value="否" type="button" onclick="PF('deleteProductDialog').hide()"/>
            </p:confirmDialog>

            <!--按钮-->
            <p:panel id="gongneng"
                     style=" align-items: center; justify-content: center;align-items: center; justify-content: center; border: 1px solid gainsboro;">
                <p:commandButton value="查询" process="@this,kuaisucchaxun" icon="fa fa-search"
                                 style="margin-left:5px" update="msg,tabT,tbs,gongneng,kuaisucchaxun"
                                 action="#{yourBean.selectwherefun()}"/>


                <p:commandButton icon="fa fa-pen-square" process="@this,tabT,tbs" update="msg,tabT,tbsgongneng"
                                 style="margin-left:5px" action="#{yourBean.update()}" value="编辑"/>



                <p:commandButton value="导出" ajax="false" icon="fa fa-file-excel-o" style="margin-left:5px">
                    <p:dataExporter type="xls" target="tbs" fileName="业务单元信息"/>
                </p:commandButton>


            </p:panel>


            <p:panel id="kuaisucchaxun"
                     style="align-items: center; justify-content: center; border: 1px solid gainsboro;">

            </p:panel>


            <p:dialog id="tabT" modal="true" header="业务单元信息维护"
                      style="width:100%;overflow-y:hidden;border:0px solid red;margin: 0;padding: 0" closable="false"
                      visible="#{yourBean.buttonStateMap['新增修改弹框']}" width="600px" height="600px">
                <p:menubar>
                    <f:facet name="options">
                        <p:commandButton style="margin-left:5px" process="@this,tabT,tbs" update="msg,tabT,tbs,gongneng"
                                         action="#{yourBean.baocun()}" value="保存"/>
                        <p:commandButton style="margin-left:5px" process="@this" update="msg,tabT,tbs,gongneng"
                                         action="#{yourBean.fangqi()}" value="关闭"/>
                    </f:facet>
                </p:menubar>

                <h:panelGrid id="tabTid" styleClass="ui-noborder">
                    <h:panelGrid columns="#{2*3}" styleClass="tabtclas" rowClasses="rowa">
                        <p:outputLabel value="#{yourBean.indexmapT['code']['tShowName']}:"/>
                        <p:outputLabel value="#{yourBean.indexmapT['code']['isMust']?'*':''}" style="color:red"/>
                        <p:inputText value="#{yourBean.indexmapT['code']['val']}"
                                     readonly="#{yourBean.getzhuangtai('T','readonly',yourBean.indexmapT['code']['tFieldName'])}"
                                     style="width:200px;color:black;opacity: 1;-webkit-text-fill-color: black;"/>

                        <p:outputLabel value="#{yourBean.indexmapT['name']['tShowName']}:"/>
                        <p:outputLabel value="#{yourBean.indexmapT['name']['isMust']?'*':''}" style="color:red"/>
                        <p:inputText value="#{yourBean.indexmapT['name']['val']}"
                                     readonly="#{yourBean.getzhuangtai('T','readonly',yourBean.indexmapT['name']['tFieldName'])}"
                                     style="width:200px;color:black;opacity: 1;-webkit-text-fill-color: black;"/>


                        <p:outputLabel value="#{yourBean.indexmapT['plmcode']['tShowName']}:"/>
                        <p:outputLabel value="#{yourBean.indexmapT['plmcode']['isMust']?'*':''}" style="color:red"/>
                        <p:inputText value="#{yourBean.indexmapT['plmcode']['val']}"
                                     readonly="#{yourBean.getzhuangtai('T','readonly',yourBean.indexmapT['plmcode']['tFieldName'])}"
                                     style="width:200px;color:black;opacity: 1;-webkit-text-fill-color: black;"/>

                        <p:outputLabel value="#{yourBean.indexmapT['plmname']['tShowName']}:"/>
                        <p:outputLabel value="#{yourBean.indexmapT['plmname']['isMust']?'*':''}" style="color:red"/>
                        <p:inputText value="#{yourBean.indexmapT['plmname']['val']}"
                                     readonly="#{yourBean.getzhuangtai('T','readonly',yourBean.indexmapT['plmname']['tFieldName'])}"
                                     style="width:200px;color:black;opacity: 1;-webkit-text-fill-color: black;"/>
                    </h:panelGrid>
                </h:panelGrid>
            </p:dialog>

            <p:panel id='tbsgongneng'></p:panel>
            <p:panel id='tabBbox' >
                <p:treeTable id="tbs" value="#{yourBean.root}" var="document"  rowIndexVar="a"
                             rowKey="#{row['iId']}" selectionMode="single"
                             selection="#{yourBean.selectedNode}" rows="25" paginator="true"
                             paginatorPosition="bottom" rowsPerPageTemplate="25,30,50,100" resizableColumns="true"
                             scrollable="true"  style="height:50vh" scrollHeight="90%">


                    <p:column headerText="编码" field="code" filterMatchMode="contains">
                        <h:outputText value="#{document.code}"/>
                    </p:column>
                    <p:column headerText="名称" field="code" filterMatchMode="contains">
                        <h:outputText value="#{document.name}"/>
                    </p:column>
                    <p:column headerText="系统编码" field="code" filterMatchMode="contains">
                        <h:outputText value="#{document.orgCode}"/>
                    </p:column>
                    <p:column headerText="系统名称" field="code" filterMatchMode="contains">
                        <h:outputText value="#{document.orgName}"/>
                    </p:column>
                    <p:column headerText="对应编码" field="plmcode" filterMatchMode="contains">
                        <h:outputText value="#{document.plmcode}"/>
                    </p:column>
                    <p:column headerText="对应名称" field="plmname" filterMatchMode="contains">
                        <h:outputText value="#{document.plmname}"/>
                    </p:column>
                </p:treeTable>

            </p:panel>
        </h:form>
    </ui:define>
</ui:composition>
